package com.shj.em.biz.purchase.service;

import com.shj.em.biz.purchase.dto.SearchPurchaseDTO;
import com.shj.em.biz.purchase.entity.Purchase;
import com.shj.em.biz.purchase.mapper.PurchaseMapper;
import com.shj.em.biz.purchase.service.PurchaseService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.plugins.Page;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;


/**
 * 采购表 服务实现类
 *
 * @author Shen Huang Jian
 * @since 2018-11-04
 */
@Service
@Transactional
public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase> implements PurchaseService {

    @Autowired
    PurchaseMapper purchaseMapper;

    public Page<Purchase> queryPurchasePage(SearchPurchaseDTO searchPurchaseDTO){
        Page<Purchase> page = new Page(searchPurchaseDTO.getPageNo(), searchPurchaseDTO.getPageSize());
        List<Purchase> list = purchaseMapper.queryPurchasePage(page, searchPurchaseDTO);
        return page.setRecords(list);
    }
}
